class GroupMgrModel {
  int status = 0;
  String message;
  List<GroupManager> data;
  GroupMgrModel({this.status = 0, this.message, this.data = const []});

  GroupMgrModel.fromJson(Map<String, dynamic> json) {
    status = json['status'];
    message = json['message'];
    if (json['data'] != null) {
      data = new List<GroupManager>();
      json['data'].forEach((v) {
        data.add(new GroupManager.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['status'] = this.status;
    data['message'] = this.message;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class GroupManager {
  String sId;
  int role;
  String groupId;
  String userId;
  bool checked;
  UserInfo userInfo;

  GroupManager(
      {this.sId,
      this.role,
      this.groupId,
      this.userId,
      this.checked,
      this.userInfo});

  GroupManager.fromJson(Map<String, dynamic> json) {
    sId = json['_id'];
    role = json['role'];
    groupId = json['group_id'];
    userId = json['user_id'];
    checked = json['checked'];
    userInfo = json['user_info'] != null
        ? new UserInfo.fromJson(json['user_info'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.sId;
    data['role'] = this.role;
    data['group_id'] = this.groupId;
    data['user_id'] = this.userId;
    data['checked'] = this.checked;
    if (this.userInfo != null) {
      data['user_info'] = this.userInfo.toJson();
    }
    return data;
  }
}

class UserInfo {
  String userId;
  String token;
  String phoneNumber;
  String createdAt;
  String updatedAt;
  String avatar;
  String nickname;

  UserInfo(
      {this.userId,
      this.token,
      this.phoneNumber,
      this.createdAt,
      this.updatedAt,
      this.avatar,
      this.nickname});

  UserInfo.fromJson(Map<String, dynamic> json) {
    userId = json['userId'];
    token = json['token'];
    phoneNumber = json['phoneNumber'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    avatar = json['avatar'];
    nickname = json['nickname'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['userId'] = this.userId;
    data['token'] = this.token;
    data['phoneNumber'] = this.phoneNumber;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['avatar'] = this.avatar;
    data['nickname'] = this.nickname;
    return data;
  }
}
